package cn.itcast.nems.studentrecord.dao.mapper;

import cn.itcast.nems.studentrecord.dao.entity.StudentRecordOrderRelationship;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 学籍和订单的关系 Mapper 接口
 * </p>
 *
 * @author liyong
 * @since 2023-11-17
 */
@Mapper
public interface StudentRecordOrderRelationshipMapper extends BaseMapper<StudentRecordOrderRelationship> {

    /**
     * 查询学籍关联的订单
     *
     * @param studentRecordId 学籍ID
     * @return 学籍关联的订单ID
     */
    Set<String> selectOrderIds(@Param("studentRecordId") String studentRecordId);

    /**
     * 根据学籍ID查询学籍订单关联信息
     * @param studentRecordId 学籍ID
     * @return 学籍订单关联数据 ，为空则为 null
     */
    List<StudentRecordOrderRelationship> findListByStudentRecordId(@Param("studentRecordId") String studentRecordId)  ;
}
